package com.yy.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author young
 * @date 2022/12/18 20:08
 * @description: rest配置
 */
@Configuration
public class RestConfig {
    /**
     * 配置restTemplate
     */
    @Bean
    //给restTemplate提供负载均衡效果，用于服务建立集群的时候
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
